#include "CaseDB/Statement.hpp"

namespace CaseDB
{

Statement::Statement( const std::string& statement)
	: statement_( statement)
{
}

// ---------------------------------------------------------------------------------------------------------------------

void Statement::addParameter( const Parameter& param )
{
	parameters_.push_back( param);
}

// ---------------------------------------------------------------------------------------------------------------------

void Statement::addParameter( DbTypes dbType, ParamDirections direction, const boost::any& value )
{
	this->addParameter( Parameter( dbType, direction, value));
}

// ---------------------------------------------------------------------------------------------------------------------

void Statement::addParameter( DbTypes dbType, const boost::any& value )
{
	this->addParameter( Parameter( dbType, ParamDirectionsEnum::In, value));
}

// ---------------------------------------------------------------------------------------------------------------------

void Statement::addParameter( DbTypes dbType )
{
	this->addParameter( Parameter( dbType, ParamDirectionsEnum::Out, boost::any()));
}

// ---------------------------------------------------------------------------------------------------------------------

void Statement::addParameter( int value, ParamDirections direction /*= ParamDirectionsEnum::In*/ )
{
	this->addParameter( Parameter( DbTypesEnum::Integer, direction, boost::any( value)));
}

// ---------------------------------------------------------------------------------------------------------------------

void Statement::addParameter( const std::string& value, ParamDirections direction /*= ParamDirectionsEnum::In*/ )
{
	this->addParameter( Parameter( DbTypesEnum::String, direction, boost::any( value)));
}

// ---------------------------------------------------------------------------------------------------------------------

void Statement::addParameter( double value, ParamDirections direction /*= ParamDirectionsEnum::In*/ )
{
	this->addParameter( Parameter( DbTypesEnum::Number, direction, boost::any( value)));
}

} // namespace CaseDB
